<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>监管结果登记</title>
    <script src="../../js/header.js"></script>
    <style type="text/css">
        html, body, #query {
            padding: 0px;
            margin: 0px;
        }

        #query {
            border-top: 3px solid #0D9AFF;
            padding: 25px;
        }

        .tab-title {
            font-size: 16px;
            font-weight: bold;
            border-left: 4px solid #0D9AFF;
            font-family: PingFangSC-Medium;
            padding-left: 10px;
            margin-bottom: 20px;
        }

        .el-dialog__footer {
            padding: 10px 20px 20px;
            text-align: center;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
        }

        .el-dialog__body {
            color: rgb(96, 98, 102);
            font-size: 14px;
            word-break: break-all;
            padding: 0px 20px;
        }

        #excel {
            display: none;
        }

        .el-input__inner {
            -webkit-appearance: none;
            background-color: #FFF;
            background-image: none;
            border-radius: 4px;
            border: 1px solid #DCDFE6;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            color: #606266;
            display: inline-block;
            font-size: inherit;
            height: 30px;
            line-height: 30px;
            outline: 0;
            padding: 0 15px;
            -webkit-transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
            transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
        }

        #query .el-select,
        #query .el-input-number {
            width: 100%;
        }

        .listed .el-form-item__label {
            letter-spacing: 3px;
        }

        .el-textarea {
            width: 100%;
        }

        /* 搜索按钮样式修改 */
        #query .el-button.is-circle.search_btn {
            position: absolute;
            right: 0;
            top: 0;
            border: 0;
            background: none;
        }

        #query .el-button.is-circle.search_btn i {
            font-size: 17px;
        }

        .companycredit_gonggao .el-form-item__content {
            margin-left: 0 !important;
        }

        #query .companycredit_publicstate .el-select {
            width: auto;
        }

        /* 拟制公告---封装样式 */
        .content_tab {
            padding: 20px 0;
        }

        .border_btm {
            border-bottom: 1px solid #ddd;
        }

        .border_left {
            border-left: 1px solid #ddd;
        }
    </style>
</head>
<body>
<div v-cloak id="query">
    <div style="margin-top: 10px;">
        <div style="margin-top: 10px;border-bottom:1px solid rgba(200,200,200,0.43);">
            <el-form :model="selectForm" :rules="rules" ref="selectForm" label-width="150px">
                <el-row>
                    <el-col :span="7">
                        <el-form-item label="项目名称:" prop="" label-width="110px">
                            <el-input v-model="selectForm.projectName" :maxlength=25 placeholder=""></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="经办人:" prop="" label-width="110px">
                            <el-input v-model="selectForm.createUser" placeholder="" :maxlength=25></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col span="8">
                        <el-form-item label="办理机构:" prop="selectForm.createUserUnit" label-width="110px">
                            <el-select v-model="selectForm.createUserUnit" placeholder="">
                                <el-option
                                        v-for="item in orgList"
                                        :key="item.dictCode"
                                        :label="item.dictName"
                                        :value="item.dictName"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col span="7">
                        <el-form-item label="行政区划:" prop="" label-width="110px">
                            <el-input v-model="selectForm.administrativeDivision" placeholder=""
                                      :maxlength=25></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="办理时间:" prop="" label-width="110px">
                            <el-date-picker
                                    v-model="selectForm.startTime"
                                    type="date"
                                    :editable="false"
                                    :clearable="false"
                                    value-format="yyyy-MM-dd"
                                    placeholder="开始时间"
                                    style="width: 190px;"
                                    @change="changeval()"
                            >
                            </el-date-picker>
                            <span style="color: rgb(192, 204, 218);text-align: center;">—</span>
                            <el-date-picker
                                    v-model="selectForm.endTime"
                                    type="date"
                                    :editable="false"
                                    :clearable="false"
                                    value-format="yyyy-MM-dd"
                                    placeholder="结束时间"
                                    style="width: 195px;"
                                    @change="changeval()"
                            >
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col span="8">
                        <el-form-item label="单位名称:" prop="" label-width="110px">
                            <el-input v-model="selectForm.unitName" placeholder="" :maxlength=25></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col span="7">
                        <el-form-item label="监管实体类别:" prop="" label-width="110px">
                            <el-select v-model="selectForm.supervisionType" placeholder="请选择">
                                <el-option label="检测环境" value="0"></el-option>
                                <el-option label="其他" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="状态:" prop="" label-width="110px">
                            <el-select v-model="selectForm.status" placeholder="请选择">
                                <el-option label="未提交" value="0"></el-option>
                                <el-option label="已提交" value="1"></el-option>
                                <el-option label="已撤回" value="2"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!--  </el-row>
                      <el-row style="margin-bottom: 30px;">-->
                    <div style="float: right;">
                        <el-button type="success" size="small" style="width: 60px;height: 30px;" @click="newForm()">新建
                        </el-button>
                        <el-button type="primary" size="small" style="width: 60px;height: 30px;"
                                   @click="searchForm('selectForm')">查询
                        </el-button>
                        <el-button type="warning" size="small" style="width: 60px;height: 30px;"
                                   @click="resetForm('selectForm')">重置
                        </el-button>
                    </div>
                </el-row>
            </el-form>
        </div>
    </div>
    <!--展示列表-->
    <el-table :data="tableData" border style="width: 100%;margin-top: 35px;"
              :header-cell-style="{background:'#eef1f6',color:'#606266'}">
        <el-table-column type="selection"></el-table-column>
        <el-table-column
                prop=""
                type="index"
                label="序号"
                width="50"
                align="center">
        </el-table-column>
        <el-table-column
                prop="createUser"
                label="经办人"
                width="120"
                align="center">
        </el-table-column>
        <el-table-column
                prop="createUserUnit"
                label="办理机构"
                width="150"
                align="center">
        </el-table-column>
        <el-table-column
                prop="submitTime"
                label="办理时间"
                width="130"
                align="center">
        </el-table-column>
        <el-table-column
                prop="projectName"
                label="项目名称 "
                width="150"
                align="center">
        </el-table-column>
        <el-table-column
                prop="unitName"
                label="单位名称 "
                width="150"
                align="center">
        </el-table-column>
        <el-table-column
                prop="supervisionType"
                label="监管实体类别"
                width="150"
                align="center">
            <template slot-scope="scope">
                <span v-if="scope.row.supervisionType==0">检测环境</span>
                <span v-if="scope.row.supervisionType==1">其他</span>
            </template>
        </el-table-column>
        <el-table-column
                prop="status"
                label="状态"
                width="110"
                align="center">
            <template slot-scope="scope">
                <span v-if="scope.row.status==0" style="color:#F19437;">未提交</span>
                <span v-if="scope.row.status==1" style="color:#20A0FF;">已提交</span>
                <span v-if="scope.row.status==2" style="color:#FF4949;">已撤回</span>
            </template>
        </el-table-column>
        <el-table-column
                label="操作"
                width=""
                align="center">
            <template slot-scope="scope">
                <span v-if="scope.row.status==0">
                <el-button size="mini" @click=" checkContent(scope.$index,scope.row)">查看</el-button>
                <el-button type="primary" size="mini" @click="edit(scope.$index,scope.row)">修改</el-button>
                <el-button type="danger" size="mini" @click="del(scope.$index,scope.row)">删除</el-button>
                <el-button type="success" size="mini" @click="effect(scope.$index,scope.row)">提交</el-button>
                <el-button type="warning" size="mini" @click="revokeInfo(scope.$index,scope.row)"
                           disabled>撤销</el-button>
                </span>
                <span v-if="scope.row.status==1">
                <el-button size="mini" @click=" checkContent(scope.$index,scope.row)">查看</el-button>
                <el-button type="primary" size="mini" @click="edit(scope.$index,scope.row)" disabled>修改</el-button>
                <el-button type="danger" size="mini" @click="del(scope.$index,scope.row)" disabled>删除</el-button>
                <el-button type="success" size="mini" @click="effect(scope.$index,scope.row)" disabled>提交</el-button>
                <el-button type="warning" size="mini" @click="revokeInfo(scope.$index,scope.row)">撤销</el-button>
                </span>
                <span v-if="scope.row.status==2">
                <el-button size="mini" @click=" checkContent(scope.$index,scope.row)">查看</el-button>
                <el-button type="primary" size="mini" @click="edit(scope.$index,scope.row)">修改</el-button>
                <el-button type="danger" size="mini" @click="del(scope.$index,scope.row)">删除</el-button>
                <el-button type="success" size="mini" @click="effect(scope.$index,scope.row)">提交</el-button>
                <el-button type="warning" size="mini" @click="revokeInfo(scope.$index,scope.row)"
                           disabled>撤销</el-button>
                </span>
            </template>
        </el-table-column>
    </el-table>
    <div style="overflow: hidden;">
        <div class="pagination">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-sizes="[10, 20, 30, 40]"
                    :page-size="pagesize"
                    background
                    layout="total, sizes,prev, pager, next"
                    :total="tableTotal"
                    prev-text="上一页"
                    next-text="下一页">
            </el-pagination>
        </div>
    </div>
    <!--详情-->
    <el-dialog title="" :visible.sync="dialogForm" center fullscreen>
        <div style="margin-top: 10px;">
            <el-form :model="Detail" :rules="rules" ref="Detail" label-width="140px" class="form_date_width">
                <el-row>
                    <el-col :span="8" class="tab-title">
                        监管结果登记详情
                    </el-col>
                </el-row>

                <el-row>
                    <!--2020.7.17：新增以下两个字段-->
                    <el-col :span="10">
                        <el-form-item label="标题:" prop="title" label-width="140px" :rules="rules.title">
                            <el-input v-model.trim="Detail.title" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="监管对象名称:" prop="supervisionObjectName" label-width="140px" :rules="rules.supervisionObjectName">
                            <el-input v-model.trim="Detail.supervisionObjectName" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="10">
                        <el-form-item label="项目名称:" prop="projectName" label-width="140px" :rules="rules.projectName">
                            <el-input v-model.trim="Detail.projectName" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="建设位置:" prop="jianPlace" label-width="140px" :rules="rules.jianPlace">
                            <el-input v-model.trim="Detail.jianPlace" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="单位名称:" prop="unitName" label-width="140px" :rules="rules.unitName">
                            <el-input v-model.trim="Detail.unitName" placeholder="" :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="行政区划:" prop="administrativeDivision" label-width="140px"
                                      :rules="rules.administrativeDivision">
                            <el-input v-model.trim="Detail.administrativeDivision" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="工程类型:" prop="projectType" label-width="140px" :rules="rules.projectType">
                            <el-input v-model.trim="Detail.projectType" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="项目类型:" prop="itemType" label-width="140px" :rules="rules.itemType">
                            <el-input v-model.trim="Detail.itemType" placeholder="" :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="联系人:" prop="linkman" label-width="140px" :rules="rules.linkman">
                            <el-input v-model.trim="Detail.linkman" placeholder="" :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="联系电话:" prop="linkmanPhone" label-width="140px" :rules="rules.linkmanPhone">
                            <el-input v-model="Detail.linkmanPhone" placeholder="" :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="是否影响:" prop="isAffect" label-width="140px" :rules="rules.isAffect">
                            <el-select v-model="Detail.isAffect " :disabled="formDisabled">
                                <el-option label="是" value="0"></el-option>
                                <el-option label="否" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="是否办理行政许可:" prop="administrativeLicense" label-width="140px"
                                      :rules="rules.administrativeLicense">
                            <el-select v-model="Detail.administrativeLicense " :disabled="formDisabled">
                                <el-option label="已办理" value="0"></el-option>
                                <el-option label="未办理" value="1"></el-option>
                                <el-option label="无需办理" value="2"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="经办人:" prop="createUser" label-width="140px" :rules="rules.createUser">
                            <el-input v-model="Detail.createUser" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="办理机构:" prop="createUserUnit" label-width="140px"
                                      :rules="rules.createUserUnit">
                            <el-input v-model="Detail.createUserUnit" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="办理时间:" prop="submitTime" label-width="140px" :rules="rules.submitTime">
                            <el-date-picker
                                    v-model="Detail.submitTime"
                                    type="date"
                                    :editable="false"
                                    value-format="yyyy-MM-dd"
                                    placeholder="办理时间"
                                    :disabled="formDisabled">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="监管实体类别:" prop="supervisionType" label-width="140px"
                                      :rules="rules.supervisionType">
                            <el-select v-model="Detail.supervisionType " :disabled="formDisabled">
                                <el-option label="检测环境" value="0"></el-option>
                                <el-option label="其他" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if="this.Detail.otherMsg !=''">
                    <el-col :span="20">
                        <el-form-item label="撤回原因:" prop="otherMsg" label-width="130px">
                            <el-input
                                    type="textarea"
                                    :autosize="{ minRows: 8, maxRows: 8}"
                                    placeholder="请输入内容"
                                    v-model="Detail.otherMsg"
                                    :disabled="formDisabled">
                            </el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <!--<el-row>
                    <el-col :span="20">
                        <el-form-item label="附件:" prop="" label-width="140px">
                            <iframe width="100%"  style="height: 200px;border: none;"   :src="link1"></iframe>
                        </el-form-item>
                    </el-col>
                </el-row>-->
                <el-row>
                    <el-col :span="20">
                        <div style="float:right">
                                <span v-if="showOnSubmit == false">
                                <el-button type="primary" size="small" style="width: 60px;height: 30px;"
                                           @click="save('Detail')">暂存</el-button>
                                <el-button type="success" size="small" style="width: 60px;height: 30px;"
                                           @click="fabu('Detail')">提交</el-button>
                                </span>
                            <sapn v-if="showbutton==true">
                                <el-button type="success" size="small" style="width: 60px;height: 30px;"
                                           @click="xiugai('Detail')">修改
                                </el-button>
                            </sapn>
                            <el-button type="info" size="small" style="width: 60px;height: 30px;" @click="guanbi()">关闭
                            </el-button>
                        </div>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </el-dialog>

    <el-dialog title="" :visible.sync="revokedialogForm" center fullscreen>
        <div style="margin-top: 10px;">
            <el-form :model="Detail" :rules="rules" ref="Detail" label-width="140px" class="form_date_width">
                <el-row>
                    <el-col :span="8" class="tab-title">
                        监管结果登记详情
                    </el-col>
                </el-row>
                <el-row>
                    <!--2020.7.17：新增以下两个字段-->
                    <el-col :span="10">
                        <el-form-item label="标题:" prop="title" label-width="140px">
                            <el-input v-model.trim="Detail.title" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="监管对象名称:" prop="supervisionObjectName" label-width="140px">
                            <el-input v-model.trim="Detail.supervisionObjectName" placeholder=""
                                      :disabled="formDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="10">
                        <el-form-item label="项目名称:" prop="" label-width="140px">
                            <el-input v-model="Detail.projectName" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="建设位置:" prop="" label-width="140px">
                            <el-input v-model="Detail.jianPlace" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="单位名称:" prop="" label-width="140px">
                            <el-input v-model="Detail.unitName" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="行政区划:" prop="" label-width="140px">
                            <el-input v-model="Detail.administrativeDivision" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="工程类型:" prop="" label-width="140px">
                            <el-input v-model="Detail.projectType" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="项目类型:" prop="" label-width="140px">
                            <el-input v-model="Detail.itemType" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="联系人:" prop="" label-width="140px">
                            <el-input v-model="Detail.linkman" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="联系电话:" prop="" label-width="140px">
                            <el-input v-model="Detail.linkmanPhone" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="是否影响:" prop="" label-width="140px">
                            <el-select v-model="Detail.isAffect " disabled>
                                <el-option label="是" value="0"></el-option>
                                <el-option label="否" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="是否办理行政许可:" prop="" label-width="140px">
                            <el-select v-model="Detail.administrativeLicense " disabled>
                                <el-option label="已办理" value="0"></el-option>
                                <el-option label="未办理" value="1"></el-option>
                                <el-option label="无需办理" value="2"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="经办人:" prop="" label-width="140px">
                            <el-input v-model="Detail.createUser" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="办理机构:" prop="" label-width="140px">
                            <el-input v-model="Detail.createUserUnit" placeholder="" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="办理时间:" prop="" label-width="140px">
                            <el-date-picker
                                    v-model="Detail.submitTime"
                                    type="date"
                                    :editable="false"
                                    value-format="yyyy-MM-dd"
                                    placeholder="创建时间"
                                    disabled>
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="监管实体类别:" prop="" label-width="140px">
                            <el-select v-model="Detail.supervisionType " disabled>
                                <el-option label="检测环境" value="0"></el-option>
                                <el-option label="其他" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if="this.Detail.otherMsg !=''">
                    <el-col :span="20">
                        <el-form-item label="撤回原因:" prop="otherMsg" label-width="130px" :rules="rules.otherMsg">
                            <el-input
                                    type="textarea"
                                    :autosize="{ minRows: 8, maxRows: 8}"
                                    placeholder="请输入内容"
                                    v-model="Detail.otherMsg"
                            >
                            </el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <!--<el-row>
                    <el-col :span="20">
                        <el-form-item label="附件:" prop="" label-width="140px">
                            <iframe width="100%"  style="height: 200px;border: none;"   :src="link1"></iframe>
                        </el-form-item>
                    </el-col>
                </el-row>-->
                <el-row>
                    <el-col :span="20">
                        <div style="float:right">
                            <el-button type="success" size="small" style="width: 60px;height: 30px;"
                                       @click="revoke('Detail')">提交
                            </el-button>
                            <el-button type="info" size="small" style="width: 60px;height: 30px;"
                                       @click="guanbirevokedialogForm()">关闭
                            </el-button>
                        </div>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </el-dialog>

</div>
<script>
    var vm = new Vue({
        el: '#query',
        data() {
            return {
                orgList: [],
                link1: '',
                uuid: '',
                userName: '',
                orgName: '',
                revokedialogForm: false,
                dialogForm: false,
                currentPage: 1,
                pagesize: 10,
                Detail: {
                    id: '',
                    // 标题
                    title: '',
                    // 监管对象名称
                    supervisionObjectName: '',
                    projectName: '',
                    jianPlace: '',
                    unitName: '',
                    administrativeDivision: '',
                    projectType: '',
                    itemType: '',
                    linkman: '',
                    linkmanPhone: '',
                    isAffect: '',
                    administrativeLicense: '',
                    createUser: '',
                    createUserUnit: '',
                    submitTime: '',
                    supervisionType: '',
                    createTime: '',
                    otherMsg: ''
                },
                rules: {
                    otherMsg: [{
                        required: true,
                        message: '请输入撤回原因',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 500,
                        message: '长度在 1 到 500个字符'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写项目名称',
                        trigger: 'blur'
                    }],
                    title: [{
                        required: true,
                        message: '请输入标题',
                        trigger: 'blur'
                    }],
                    supervisionObjectName: [{
                        required: true,
                        message: '请输入监管对象名称',
                        trigger: 'blur'
                    }],
                    createUser: [{
                        required: true,
                        message: '请输入创建人',
                        trigger: 'blur'
                    }],
                    createUserUnit: [{
                        required: true,
                        message: '请输入创建人单位',
                        trigger: 'blur'
                    }],
                    projectName: [{
                        required: true,
                        message: '请输入项目名称',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写项目名称',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 25,
                        message: '长度在 1 到 25个字符'
                    }],
                    jianPlace: [{
                        required: true,
                        message: '请输入建设位置',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写建设位置',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 25,
                        message: '长度在 1 到 25个字符'
                    }],
                    supervisionType: [{
                        required: true,
                        message: '请选择监管实体类别',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写监管实体类别',
                        trigger: 'blur'
                    }],
                    unitName: [{
                        required: true,
                        message: '请输入单位名称',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写单位名称',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 25,
                        message: '长度在 1 到 25个字符'
                    }],
                    administrativeDivision: [{
                        required: true,
                        message: '请输入行政区划',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写行政区划',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 25,
                        message: '长度在 1 到 25个字符'
                    }],
                    projectType: [{
                        required: true,
                        message: '请输入工程类型',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写工程类型',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 25,
                        message: '长度在 1 到 25个字符'
                    }],
                    itemType: [{
                        required: true,
                        message: '请输入项目类型',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写项目类型',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 25,
                        message: '长度在 1 到 25个字符'
                    }],
                    linkman: [{
                        required: true,
                        message: '请输入联系人',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写联系人',
                        trigger: 'blur'
                    }, {
                        min: 1,
                        max: 25,
                        message: '长度在 1 到 25个字符'
                    }],
                    linkmanPhone: [{
                        required: true,
                        message: '请输入联系电话',
                        trigger: 'blur'
                    }, {
                        validator: trimIsEmpty,
                        message: '填写联系电话',
                        trigger: 'blur'
                    }, {
                        validator: function (rule, value, callback) {
                            if (/^1[34578]\d{9}$/.test(value) == false) {
                                callback(new Error("请输入正确的手机号"));
                            } else {
                                callback();
                            }
                        }, trigger: 'blur'
                    }
                    ],
                    isAffect: [{
                        required: true,
                        message: '请选择是否影响',
                        trigger: 'blur'
                    }],
                    administrativeLicense: [{
                        required: true,
                        message: '请选择是否办理行政许可',
                        trigger: 'blur'
                    }],
                    submitTime: [{
                        required: true,
                        message: '请选择办理时间',
                        trigger: 'blur'
                    }],
                },
                tableTotal: '',
                tableData: [],
                selectForm: {
                    projectName: '',
                    administrativeDivision: '',
                    createUser: '',
                    createUserUnit: '',
                    startTime: '',
                    endTime: '',
                    status: '',
                    supervisionType: '',
                    unitName: ''
                },
                Form: {
                    projectName: '',
                    administrativeDivision: '',
                    createUser: '',
                    createUserUnit: '',
                    startTime: '',
                    endTime: '',
                    status: '',
                    supervisionType: '',
                    unitName: ''
                },
                selectFormDisabled: false,
            }
        },
        created() {
            var userInfo = JSON.parse(localStorage.getItem("userInfo"));
            this.orgName = userInfo.orgName;
            this.userName = userInfo.loginName;
            /* 机构 */
            axios.post('/dzjjcss/dict/getdict/d_org').then(res => {
                this.orgList = res.data.data.result;
                console.log(this.orgList)
            }).catch(e => {
                this.$message.error("网络连接超时");
            });
            let date = new Date();
            let y = date.getFullYear();
            let MM = date.getMonth() + 1;
            MM = MM < 10 ? ('0' + MM) : MM;
            let d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            let h = date.getHours();
            h = h < 10 ? ('0' + h) : h;
            let m = date.getMinutes();
            m = m < 10 ? ('0' + m) : m;
            let s = date.getSeconds();
            s = s < 10 ? ('0' + s) : s;
            console.log(y + '-' + MM + '-' + d);
            this.Detail.createTime = y + '-' + MM + '-' + d;
        },
        mounted() {
            this.getData();
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                axios({
                    method: 'get',
                    url: '/dzjjcss/resultRegister/publicityList',
                    params: {
                        projectName: this.Form.projectName.trim(),
                        administrativeDivision: this.Form.administrativeDivision.trim(),
                        supervisionType: this.Form.supervisionType,
                        createUser: this.Form.createUser.trim(),
                        unitName: this.Form.unitName.trim(),
                        createUserUnit: this.Form.createUserUnit,
                        status: this.Form.status,
                        releaseStartTime: this.Form.startTime,
                        releaseEndTime: this.Form.endTime,
                        pageNo: pageno,
                        pageSize: pagesize

                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let dataInformation = response.data.data.results;
                            this.tableTotal = response.data.data.total;// 数据长度
                            this.tableData = dataInformation;
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            /* 列表页搜索 */
            searchForm(selectForm) {
                this.Form = this.selectForm;
                this.currentPage = 1;
                axios({
                    method: 'get',
                    url: '/dzjjcss/resultRegister/publicityList',
                    params: {
                        projectName: this.Form.projectName.trim(),
                        administrativeDivision: this.Form.administrativeDivision.trim(),
                        supervisionType: this.Form.supervisionType,
                        createUser: this.Form.createUser.trim(),
                        unitName: this.Form.unitName.trim(),
                        createUserUnit: this.Form.createUserUnit,
                        status: this.Form.status,
                        releaseStartTime: this.Form.startTime,
                        releaseEndTime: this.Form.endTime,
                        pageSize: this.pagesize,
                        pageNo: this.currentPage,
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let dataInformation = response.data.data.results;
                            this.tableTotal = response.data.data.total;// 数据长度
                            this.tableData = dataInformation;
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            changeval() {
                if (this.selectForm.endTime != '') {
                    if (this.selectForm.startTime > this.selectForm.endTime) {
                        this.$message.error("办理开始时间必须小于办理结束日期");
                        return;
                    }
                }
                if (this.selectForm.startTime != '' && this.selectForm.endTime != '') {
                    if (this.selectForm.startTime > this.selectForm.endTime) {
                        this.$message.error("办理开始时间必须小于办理结束日期");
                        return;
                    }
                }

            },
            newForm() {
                // this.getUuid();
                this.showbutton = false;
                this.dialogForm = true;
                this.checkDisabled(false);
                this.showOnSubmit = false;
                this.Detail.createUser = this.userName;
                this.Detail.createUserUnit = this.orgName;
            },
            guanbi() {
                this.dialogForm = false;
                this.clearDetail();
                this.getData();
            },
            guanbirevokedialogForm() {
                this.revokedialogForm = false;
                this.clearDetail();
                this.getData();
            },
            //获取UUID的方法
            getUuid() {
                axios({
                    method: 'get',
                    url: '/dzjjcss/uuid/getUuid',
                })
                    .then(response => {
                        if (response.data.code == 200) {
                            debugger;
                            this.uuid = response.data.data;
                            this.Detail.id = this.uuid;
                            this.link1 = "../upload/annex.html?uuid=" + this.uuid + "&flag=1";
                        } else {
                            this.$message.error(response.data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            // 查看
            checkContent(index, row) {
                this.link1 = "../upload/annex.html?uuid=" + row.id + "&flag=0";
                this.showOnSubmit = true;
                this.showbutton = false;
                this.dialogForm = true;
                this.showInformation(index, row);
                this.checkDisabled(true);
            },
            // 修改
            edit(index, row) {
                this.Detail = row;
                this.Detail.otherMsg = '';
                this.showOnSubmit = true;
                this.showbutton = true;
                this.dialogForm = true
                this.checkDisabled(false);

            },
            // 撤回
            revokeInfo(index, row) {
                this.revokedialogForm = true
                this.showInformation(index, row);
            },
            // 删除
            del(index, row) {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                var afterPage = Math.floor(this.tableTotal / pagesize);
                var nowSize = this.tableTotal % pagesize;
                this.$confirm('确定要删除吗?', '提示', {
                    cancelButtonText: '取消',
                    confirmButtonText: '确定',
                    type: 'warning'
                }).then(() => {
                    axios({
                        method: 'post',
                        url: '/dzjjcss/resultRegister/delete',
                        params: {
                            id: row.id,
                        }
                    })
                        .then(response => {
                            let data = response.data;
                            if (data.code == 200) {
                                debugger;
                                // 确认删除
                                this.$message({
                                    type: 'success',
                                    message: '删除成功!'
                                });
                                if (nowSize == '1' && afterPage >= '0') {
                                    if (afterPage == '0') {
                                        this.currentPage = 1;
                                    } else {
                                        this.currentPage = afterPage;
                                    }
                                    this.getData();
                                } else {
                                    this.getData();
                                }
                            } else {
                                this.$message.error(data.msg);
                            }
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消删除'
                    });
                });
            },
            revoke(index, row) {
                this.$refs.Detail.validate((valid) => {
                    if (valid) {
                        axios({
                            method: 'post',
                            url: '/dzjjcss/resultRegister/recall',
                            params: {
                                id: this.Detail.id,
                                otherMsg: this.Detail.otherMsg

                            }
                        })
                            .then(response => {
                                let data = response.data;
                                console.log(response);
                                if (data.code == 200) {
                                    // 确认撤销
                                    this.$message({
                                        type: 'success',
                                        message: '撤销成功!'
                                    });
                                    this.guanbirevokedialogForm();
                                } else {
                                    this.$message.error(data.msg);
                                }
                            })
                            .catch(function (error) {
                                console.log(error);
                            });
                    }
                })
            },
            //生效
            effect(index, row) {
                this.$confirm('确定提交要吗?', '提示', {
                    cancelButtonText: '取消',
                    confirmButtonText: '确定',
                    type: 'warning'
                }).then(() => {
                    axios({
                        method: 'post',
                        url: '/dzjjcss/resultRegister/release',
                        params: {
                            id: row.id,
                        }
                    })
                        .then(response => {
                            let data = response.data;
                            console.log(response);
                            if (data.code == 200) {
                                this.$message({
                                    type: 'success',
                                    message: '提交成功!'
                                });
                                this.resetForm();
                                this.getData();
                            } else {
                                this.$message.error(data.msg);
                            }
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消提交'
                    });
                });
            },
            //表单修改
            xiugai(Detail) {
                this.$refs.Detail.validate((valid) => {
                    if (valid) {
                        axios({
                            method: 'post',
                            url: '/dzjjcss/resultRegister/update',
                            data: this.Detail
                        })
                            .then((response) => {
                                let data = response.data;
                                if (data.code == 200) {
                                    this.guanbi();
                                    this.$message({
                                        type: 'success',
                                        message: '修改成功!'
                                    });

                                } else {
                                    this.$message.error(data.msg);
                                }
                            })
                    }
                })
            },
            //表单保存
            fabu(Detail) {
                this.$refs.Detail.validate((valid) => {
                    if (valid) {
                        axios({
                            method: 'post',
                            url: '/dzjjcss/resultRegister/save',
                            data: this.Detail
                        })
                            .then((response) => {
                                let data = response.data;
                                if (data.code == 200) {
                                    this.guanbi();
                                    this.$message({
                                        type: 'success',
                                        message: '保存成功!'
                                    });

                                } else {
                                    this.$message.error(data.msg);
                                }
                            })
                    }
                })
            },
            // 表单暂存
            save(Detail) {
                this.$refs.Detail.validate((valid) => {
                    if (valid) {
                        axios({
                            method: 'post',
                            url: '/dzjjcss/resultRegister/saveOnly',
                            data: this.Detail
                        })
                            .then((response) => {
                                let data = response.data;
                                if (data.code == 200) {
                                    this.guanbi();
                                    this.$message({
                                        type: 'success',
                                        message: '暂存成功!'
                                    });
                                    this.resetForm();
                                    this.getData();
                                } else {
                                    this.$message.error(data.msg);
                                }
                            });
                    }
                })

            },
            /* 列表页重置 */
            resetForm(formName) {
                this.selectForm.projectName = '';
                this.selectForm.createUser = '';
                this.selectForm.createUserUnit = '';
                this.selectForm.status = '';
                this.selectForm.startTime = '';
                this.selectForm.endTime = '';
                this.selectForm.administrativeDivision = '';
                this.selectForm.supervisionType = '';
                this.selectForm.unitName = '';
                this.Form.projectName = '';
                this.Form.createUser = '';
                this.Form.createUserUnit = '';
                this.Form.status = '';
                this.Form.startTime = '';
                this.Form.endTime = '';
                this.Form.administrativeDivision = '';
                this.Form.supervisionType = '';
                this.Form.unitName = '';
                this.getData();
            },
            clearDetail() {
                this.Detail.id = '',
                    this.Detail.projectName = '',
                    this.Detail.jianPlace = '',
                    this.Detail.unitName = '',
                    this.Detail.administrativeDivision = '',
                    this.Detail.projectType = '',
                    this.Detail.itemType = '',
                    this.Detail.linkman = '',
                    this.Detail.linkmanPhone = '',
                    this.Detail.isAffect = '',
                    this.Detail.administrativeLicense = '',
                    this.Detail.createUser = '',
                    this.Detail.supervisionType = '',
                    this.Detail.createUserUnit = '',
                    this.Detail.submitTime = '',
                    this.Detail.otherMsg = ''

            },
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            },
            // 设置允许填写和不允许填写
            checkDisabled(n) {
                if (n) {
                    this.formDisabled = true;
                    this.replyformDisabled = true;
                } else {
                    this.formDisabled = false;
                    this.replyformDisabled = false;
                }
            },
            // 公共方法--查看
            showInformation(index, row) {
                axios({
                    method: 'get',
                    url: '/dzjjcss/resultRegister/queryById',
                    params: {
                        id: row.id
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            debugger;
                            this.Detail = response.data.data;
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
        }
    })
</script>
</body>
</html>